package com.sz.zhiling.controller;

import com.sz.zhiling.service.IMyUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/users")
public class MyUsersController {


    @Autowired
    private IMyUserService iMyUserService;

    @RequestMapping("/list")
    public String list(Model model,@RequestParam(required = true, defaultValue = "1") int index){
        model.addAttribute("pb",iMyUserService.getAllUsers(index));
        return "users/list";
    }
}
